eventcontrollerscroll: Emit ::scroll for -1/+1 discrete steps
authorTimm Bäder <mail@baedert.org>
Wed, 11 Oct 2017 06:06:33 +0000 (08:06 +0200)
committerTimm Bäder <mail@baedert.org>
Wed, 11 Oct 2017 06:50:21 +0000 (08:50 +0200)
The > 1 meant it only emits the signal for -2/+2 steps.

gtk/gtkeventcontrollerscroll.c

index a250bfb8aa7450609abb507c14b1b42442a00350..407f254c8b814b171e1842183abb4d9e247e0429 100644 (file)
@@ -239,14 +239,14 @@ gtk_event_controller_scroll_handle_event (GtkEventController *controller,
           scroll->cur_dy += dy;
           dx = dy = 0;
 
-          if (ABS (scroll->cur_dx) > 1)
+          if (ABS (scroll->cur_dx) >= 1)
             {
               steps = trunc (scroll->cur_dx);
               scroll->cur_dx -= steps;
               dx = steps;
             }
 
-          if (ABS (scroll->cur_dy) > 1)
+          if (ABS (scroll->cur_dy) >= 1)
             {
               steps = trunc (scroll->cur_dy);
               scroll->cur_dy -= steps;